package main

import "fmt"

//演示结构体类型转换
//1.结构体转换时要求 两边结构体的定义是一样的（字段名，字段个数，字段类型一模一样）
//2.即使是别名也必须强制转换
func main() {
	var t1 T1 = T1{1, "t1"}
	var t2 T2 = T2{2, "t2"}
	t1 = T1(t2)
	var t2Other = t2Other(t2)
	fmt.Println(t1, t2)
	fmt.Println(t2Other)
}

type T1 struct {
	Id   int32
	Name string
}

type T2 struct {
	Id   int32
	Name string
}

type t2Other T2
